﻿<DebuggerDisplay("{m_value} | {m_targetState.Index}")>
Public NotInheritable Class NFAEdge
    Friend Sub New(ByVal value As Char, ByVal targetState As NFAState)
        m_value = value
        m_targetState = targetState
    End Sub

    Friend Sub New(ByVal value As CharRange, ByVal targetState As NFAState)
        m_value = value
        m_targetState = targetState
    End Sub

    Friend Sub New(ByVal targetState As NFAState)
        m_value = Nothing
        m_targetState = targetState
    End Sub

    Private ReadOnly m_value As Object

    Public ReadOnly Property IsCharRangeCondition As Boolean
        Get
            Return Not IsEmptyCondition AndAlso TypeOf m_value Is CharRange
        End Get
    End Property

    Public ReadOnly Property IsEmptyCondition As Boolean
        Get
            Return m_value Is Nothing
        End Get
    End Property

    Public Function GetConditionValue() As Object
        Return m_value
    End Function

    Private ReadOnly m_targetState As NFAState
    Public ReadOnly Property TargetState() As NFAState
        Get
            Return m_targetState
        End Get
    End Property

    Private m_priority As Integer
    Public Property Priority() As Integer
        Get
            Return m_priority
        End Get
        Friend Set(ByVal value As Integer)
            m_priority = value
        End Set
    End Property

End Class

